import { IRoleVO, list } from '@/api/admin/role';
import { ref } from 'vue';

export function useRole() {
	const roleList = ref<IRoleVO[]>([]);
	const roleLoading = ref(false);

	async function fetchRole() {
		roleLoading.value = true;
		const res = await list();
		roleList.value = res.data;
		roleLoading.value = false;
	}

	return {
		roleList,
		roleLoading,
		fetchRole,
	};
}
